"""首页"""
from selenium.webdriver.common.by import By

from dianzishangwu_testing.page_objects.base_page import BasePage


class HomePage(BasePage):

    __PARENT_MUNE = (By.XPATH, "//*[text()='商场管理']/..")
    __CHILD_MUNE = (By.XPATH, "//*[text()='商品类目']/..")

    """首页：进入商品类目"""
    def go_to_category(self):
        self.do_find(self.__PARENT_MUNE).click()
        self.do_find(self.__CHILD_MUNE).click()

        from dianzishangwu_testing.page_objects.category_list_page import CategoryListPage
        return CategoryListPage(self.driver)